Skip to content

Conversation

@catalyst17
Copy link
Contributor

@catalyst17 catalyst17 commented Jan 29, 2025

Adds a table with in/out txns for a wallet


PR-Codex overview

This PR focuses on updating dependencies, enhancing the handling of transactions, and improving the UI components related to token holdings and activity overview in the dashboard.

Detailed summary

  • Removed @radix-ui/react-tabs from package.json.
  • Updated clientId handling in getBalance.ts.
  • Changed top_bids type from any[] to unknown[] in fetchNFTs.ts.
  • Modified SimpleHashResponse interface in fetchNFTs.ts.
  • Updated TokenHoldings component to use unique keys for TableRow.
  • Enhanced NFT mapping in TokenHoldings with unique keys.
  • Added useGetTxActivity hook for fetching transaction activities.
  • Integrated transaction activity in WalletDashboard.
  • Updated ActivityOverview to include pagination for transactions.
  • Modified transaction structure in fetchTxActivity.ts.
  • Improved UI structure and key handling in ActivityOverview.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@catalyst17 catalyst17 requested review from a team as code owners January 29, 2025 05:41
@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2025

⚠️ No Changeset found

Latest commit: f9822c0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 6:10am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 6:10am
thirdweb-www ❌ Failed (Inspect) Jan 29, 2025 6:10am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 6:10am

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Jan 29, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.55 KB (0%) 932 ms (0%) 601 ms (+12.64% 🔺) 1.6 s
thirdweb (cjs) 122.35 KB (0%) 2.5 s (0%) 1.3 s (+2.09% 🔺) 3.8 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 69 ms (-5.69% 🔽) 181 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 10 ms (-13.92% 🔽) 20 ms
thirdweb/react (minimal + tree-shaking) 19.27 KB (0%) 386 ms (0%) 237 ms (+37.96% 🔺) 622 ms

@codecov
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (hackweek-wallet-explainer@0b4045b). Learn more about missing BASE report.

Additional details and impacted files
@@                     Coverage Diff                      @@
##             hackweek-wallet-explainer    #6090   +/-   ##
============================================================
  Coverage                             ?   56.82%           
============================================================
  Files                                ?     1152           
  Lines                                ?    63904           
  Branches                             ?     5180           
============================================================
  Hits                                 ?    36314           
  Misses                               ?    26861           
  Partials                             ?      729           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (?) Carriedforward from 3f08e8d
packages 55.00% <ø> (?)

*This pull request uses carry forward flags. Click here to find out more.

@catalyst17 catalyst17 removed request for a team January 29, 2025 05:57
Comment on lines +18 to +38
const [isLoading, setIsLoading] = useState(true);

useEffect(() => {
(async () => {
const response = await fetchTxActivity({ chainId, address });
const activity = response.map((tx): TxActivityItem => {
const type =
tx.to_address?.toLowerCase() === address.toLowerCase() ? "in" : "out";
return {
id: tx.hash,
type,
amount: `${tx.value / 10 ** 18} ETH`,
to: tx.to_address || undefined,
from: tx.from_address,
method: tx.function_selector || undefined,
date: new Date(tx.block_timestamp * 1000).toLocaleString(),
};
});
setTxActivity(activity);
setIsLoading(false);
})();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace useEffect-based data fetching with useQuery from React Query. The implementation should look like: useQuery(['txActivity', chainId, address], () => fetchTxActivity({chainId, address}), { select: (data) => data.map(tx => ({ ... })) })

Spotted by Graphite Reviewer (based on CI logs)

Is this helpful? React 👍 or 👎 to let us know.

@catalyst17 catalyst17 merged commit dca48c9 into hackweek-wallet-explainer Jan 29, 2025
27 of 29 checks passed
@catalyst17 catalyst17 deleted the vt-hackweek-wallet-analysis-activity branch January 29, 2025 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants